using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using Helper;
namespace CoreData
{
    public class confirm
    {
            public long id{get;set;}
            public long workid{get;set;}
            public long buyerid{get;set;}
            public long sellerid{get;set;}
            public DateTime createdate{get;set;}
            public int status{get;set;}
            public string link{get;set;}
         
        public confirm()
        {       
                    link ="";   
        }
        
       static confirm DynamicCast<T>(object row_data, object row_header) where T : confirm
       {
           // row_data : DataRow
           // row_header : DataColumnCollection
           confirm ret = new confirm();
           DataRow dt = (DataRow)row_data;

           foreach (DataColumn column in (DataColumnCollection)row_header)
           {
               switch (column.ColumnName)
               {
                      case  "id":
                        ret.id = ConvertObject.ToLong(dt[column]);
                       break;
                      case  "workid":
                        ret.workid = ConvertObject.ToLong(dt[column]);
                       break;
                      case  "buyerid":
                        ret.buyerid = ConvertObject.ToLong(dt[column]);
                       break;
                      case  "sellerid":
                        ret.sellerid = ConvertObject.ToLong(dt[column]);
                       break;
                      case  "createdate":
                        ret.createdate = ConvertObject.ToDateTime(dt[column]);
                       break;
                      case  "status":
                        ret.status = ConvertObject.ToInt(dt[column]);
                       break;
                      case  "link":
                        ret.link = ConvertObject.ToString(dt[column]);
                       break;
                
                   default:
                       break;
               }
           }

           return ret;
       }
        
    }
}
